package cheme.ProcessModel;

import java.beans.PropertyChangeEvent;

public abstract class AbstractChild extends AbstractModelElement implements IChild
{
	/*
	 * Serialization version identifier. (Set to default for now)
	 */
	
	private static final long serialVersionUID = 1L;

	public AbstractChild(IModelElement parent)
	{
		super(parent);
	}
	
	/**
	 * 
	 * @return the parent of the model element, null if the element is the root, ProcessModel of the model.
	 */
	public IParent getParent()
	{
		return (IParent)super.getParent();
	}
	
	public void setParent(IParent parent)
	{
		this.parent = parent;
	}
	
	/*
	 * Playing with propogating the event up the food chain till it gets to a 
	 * point where it can be meaningfully process (parsed).
	 * @see cheme.ProcessModel.PropertyAwareObject#handleTextChange(java.beans.PropertyChangeEvent)
	 */
	@Override
	protected void handleTextChange(PropertyChangeEvent evt)
	{
		firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
	}
	
	protected void handlebackGroundColorChange(PropertyChangeEvent evt)
	{
		firePropertyChange(IPropertyAware.P_BACKGROUNDCOLOR,null,null);
	}
}
